package com.mhkj.base.rbac.role.dao;

import java.util.List;

import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

import com.mhkj.base.rbac.role.entity.SystemRole;
import com.mics.core.system.base.repository.BaseRepository;

public interface MyRoleDao extends BaseRepository<SystemRole>{

	/**
	 * 根据角色查询项目
	 * @author mics
	 * @date 2018年9月6日
	 * @version 1.0
	 */
	@Query(value="select i.* from t_item  i left join t_sys_role_item ri on ri.item_id = i.id  left join t_sys_role sr  on sr.id = ri.sys_role_id where sr.id = :roleId",nativeQuery=true)
	List<Object[]> listItemByRole(@Param("roleId")Long roleId);
	 
}
